# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=qqc2-desktop-style
pkgver=6.1.0
pkgrel=0
pkgdesc="A style for Qt Quick Controls 2 to make it follow your desktop theme"
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-3.0-only AND (GPL-2.0-only OR GPL-3.0-only)"
depends="
	kirigami
	sonnet
	"
depends_dev="
	kconfigwidgets-dev
	kiconthemes-dev
	kirigami-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev"
_repo_url="https://invent.kde.org/frameworks/qqc2-desktop-style.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/qqc2-desktop-style-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# TextFieldContextMenuTest requires working OpenGL
	xvfb-run ctest --test-dir build --output-on-failure -E "animationspeedmodifiertest|TextFieldContextMenuTest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
befb9c9ee024fcf73a04be9495800172d2049f9a0c14d21fe8e5c7d889a1411702de2297e1a27ca11154f7471b541ab1b02b182d38622a81eabd6b3a8aca1530  qqc2-desktop-style-6.1.0.tar.xz
"
